package d6_data_stream;

import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;

/**
 * 2024/6/20 使用数据输入流读取特定类型的数据 Cjj 11:27
 */
public class DataInputStreamTest2 {
    public static void main(String[] args) {
        try (
                DataInputStream dis =
                        new DataInputStream(new FileInputStream("file-io2\\src\\test\\PrintStream1"));
        ) {
            int i = dis.readInt();
            System.out.println(i);

            double d = dis.readDouble();
            System.out.println(d);

            boolean b = dis.readBoolean();
            System.out.println(b);

            /*String s = dis.readUTF();
            System.out.println(s);*/
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
